package com.mycompany.biblio.business;

import com.mycompany.biblio.model.Comment;
import com.mycompany.biblio.model.User;
import java.util.List;
import javax.ejb.EJB;
import javax.persistence.*;
import javax.ejb.Stateless;


@Stateless
public class CommentDAO {

    // ======================================
    // =             Attributes             =
    // ======================================
    
    @EJB
    SecurityService securityService;
    
    @PersistenceContext(unitName = "jsfExamplePU")
    private EntityManager em;

    // ======================================
    // =           Public Methods           =
    // ======================================

    public List<Comment> getAllStatuses()
    {
        //receuperer tous les Comment qui sont publiques, et ceux des amis
        //Query query = em.createNamedQuery(Comment.GET_ALL_PUBLIC);       
        //return query.getResultList();  
        return null;
    }

    public Comment create(Comment Comment) {
        em.persist(Comment);
        return Comment;
    }

    public Comment update(Comment Comment) {
        return em.merge(Comment);
    }

}
